package com.atguigu.eduservice;


import com.atguigu.eduservice.entity.EduVideo;
import org.apache.commons.lang.StringUtils;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class test02 {
    @Test
    public void test1 (){
        List<EduVideo> strings = new ArrayList<>();
        EduVideo eduVideo = new EduVideo();
        EduVideo eduVideo1 = new EduVideo();
        eduVideo.setCourseId("22");
        eduVideo.setCourseId("33");
        strings.add(eduVideo);
        strings.add(eduVideo1);

        String join = StringUtils.join(strings, "++");
        String join2 = StringUtils.join(strings.toArray(), ",");
        System.out.println(join);
//        System.out.println(join2);
    }

    @Test
    public void test2 (){
        List<Integer> list = new ArrayList<>();

        list.add(1);

        list.add(1);

        Integer[] tt = (Integer[]) list.toArray(new Integer[0]);
        System.out.println(Arrays.toString(tt));
    }

}
